<?php
class Application_Model_Filter_BacklogSearch {
    /**
     * 快速搜索
     */
    public $quick;
    /**
     * 开始时间
     */
    public $startTime;
    /**
     * 结束时间
     */
    public $endTime;
    /**
     * 来源
     */
    public $sourceType;
    /**
     * 状态
     */
    public $status;
    /**
     * 发起人
     */
    public $operator;
    
    
    function getSearchFileds()
    {
        $where = array();
        $and = "";
        if($this->quick != ""){
            $where[$and." ( content like "] = "%".$this->quick."%";
            $where[" or operator like "] = "%".$this->quick."%";
            $where[") and 1 = "] =1;
            $and = " and ";
        }
        if($this->startTime != ""){
            $where[$and . " dateCreated >= "] = $this->startTime;
            $and = " and ";
        }
        if($this->endTime != ""){
            $where[$and . " dateCreated <= "] = $this->endTime;
            $and = " and ";
        }
        if($this->status != ""){
            $where[$and." status = "] = $this->status;
            $and = " and ";
        }
        if($this->sourceType != ""){
            $where[$and." sourceType = "] = $this->sourceType;
            $and = " and ";
        }
        if($this->operator != ""){
            $where[$and." operator = "] = $this->operator;
            $and = " and ";
        }
        $where[$and." SolveName = "] = Uuch_Util::getUserId();
        
        return $where;
    }
}
